import java.util.ArrayList;
import java.util.List;

import lombok.extern.slf4j.Slf4j;
@Slf4j
public class Str {
	public static void main(String[] args) {
		String str = "abcdefghijklmnopqrstuvwxyz123456789";
		new Str().getListStr(str, 20).forEach(s->{
			System.out.println(s);
		});
	}
	
	public List<String> getListStr(String str, int len) {
        List<String> listStr = new ArrayList<>();
        int strLen = str.length();
        int start = 0;
        int num = len;
        String temp = null;
        while (true) {
            try {
                if (num >= strLen) {
                    temp = str.substring(start, strLen);
                } else {
                    temp = str.substring(start, num);
                }
            } catch (Exception e) {
                log.info("拆分完毕", "");
                break;
            }
            listStr.add(temp);
            start = num;
            num = num + len;
        }
        return listStr;
    }
}
